// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 修改保存角色 PUT /api/system/role */
export async function roleEditUsingPUT(body: API.SysRole, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/system/role', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增角色 POST /api/system/role */
export async function roleAddUsingPOST(body: API.SysRole, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/system/role', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除角色 DELETE /api/system/role/${param0} */
export async function roleRemoveUsingDELETE(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.roleRemoveUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { roleIds: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/system/role/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 根据角色编号获取详细信息 GET /api/system/role/${param0} */
export async function roleGetInfoUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.roleGetInfoUsingGETParams,
  options?: { [key: string]: any },
) {
  const { roleId: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/system/role/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 查询已分配用户角色列表 GET /api/system/role/authUser/allocatedList */
export async function roleAllocatedListUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.roleAllocatedListUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.TableDataInfo>('/api/system/role/authUser/allocatedList', {
    method: 'GET',
    params: {
      ...params,
      'dept.params': undefined,
      ...params['dept.params'],
      params: undefined,
      ...params['params'],
      'roles[0].params': undefined,
      ...params['roles[0].params'],
    },
    ...(options || {}),
  });
}

/** 取消授权用户 PUT /api/system/role/authUser/cancel */
export async function roleCancelAuthUserUsingPUT(
  body: API.SysUserRole,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/system/role/authUser/cancel', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量取消授权用户 PUT /api/system/role/authUser/cancelAll */
export async function roleCancelAuthUserAllUsingPUT(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.roleCancelAuthUserAllUsingPUTParams,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/system/role/authUser/cancelAll', {
    method: 'PUT',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 批量选择用户授权 PUT /api/system/role/authUser/selectAll */
export async function roleSelectAuthUserAllUsingPUT(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.roleSelectAuthUserAllUsingPUTParams,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/system/role/authUser/selectAll', {
    method: 'PUT',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 查询未分配用户角色列表 GET /api/system/role/authUser/unallocatedList */
export async function roleUnallocatedListUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.roleUnallocatedListUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.TableDataInfo>('/api/system/role/authUser/unallocatedList', {
    method: 'GET',
    params: {
      ...params,
      'dept.params': undefined,
      ...params['dept.params'],
      params: undefined,
      ...params['params'],
      'roles[0].params': undefined,
      ...params['roles[0].params'],
    },
    ...(options || {}),
  });
}

/** 状态修改 PUT /api/system/role/changeStatus */
export async function roleChangeStatusUsingPUT(
  body: API.SysRole,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/system/role/changeStatus', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改保存数据权限 PUT /api/system/role/dataScope */
export async function roleDataScopeUsingPUT(body: API.SysRole, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/system/role/dataScope', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取对应角色部门树列表 GET /api/system/role/deptTree/${param0} */
export async function roleDeptTreeUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.roleDeptTreeUsingGETParams,
  options?: { [key: string]: any },
) {
  const { roleId: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/system/role/deptTree/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 导出角色列表 POST /api/system/role/export */
export async function roleExportUsingPOST(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.roleExportUsingPOSTParams,
  options?: { [key: string]: any },
) {
  return request<any>('/api/system/role/export', {
    method: 'POST',
    params: {
      ...params,
      params: undefined,
      ...params['params'],
    },
    ...(options || {}),
  });
}

/** 获取角色列表 GET /api/system/role/list */
export async function roleListUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.roleListUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.TableDataInfo>('/api/system/role/list', {
    method: 'GET',
    params: {
      ...params,
      params: undefined,
      ...params['params'],
    },
    ...(options || {}),
  });
}

/** 获取角色选择框列表 GET /api/system/role/optionselect */
export async function roleOptionSelectUsingGET(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/system/role/optionselect', {
    method: 'GET',
    ...(options || {}),
  });
}
